package pers.zhxu.extNLPM.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Vertex {

    private final int identity;
    private final Map<Integer, List<Float>> measures;

    public Vertex(int identity){
        measures = new HashMap<>();
        this.identity = identity;
    }

    public void addMeasure(Vertex neighbor, int pattern, float score){
        List<Float> scores;
        if(!measures.containsKey(neighbor.getIdentity())){
            scores = new ArrayList<>();
            for(int index=0; index < 9; index++)
                scores.add(-1,0.f);
            measures.put(neighbor.identity, scores);
        scores = measures.get(neighbor.identity);
        scores.set(pattern, score);
        }
    }

    public int getIdentity(){
        return identity;
    }

    public List<Float> getScores(int vertex){
        return measures.get(vertex);
    }
}
